﻿var type = getCookie('template1');
var temsel = document.getElementById('temsel');
temsel.innerHTML ='<select name="styleid" onchange="changeskin(this.options[this.selectedIndex].value);window.location.reload();"><optgroup label="اختيار التصميم السريع"><option selected="selected" value="valeur1" class="" >- اختار الاستايل السريع لتصفح</option><option value="valeur1" class="" >-- استايل معهد التطوير العربى 2014</option><option value="valeur2" class="" >-- استايل معهد التطوير العربى 2013</option><option value="valeur3" class="" >-- استايل معهد التطوير العربى الاحمر</option><option value="valeur3" class="" >-- Default Style</option></optgroup></select>';




if (type == 'valeur1')
{
	document.write('<link rel="stylesheet" type="text/css" href="https://arab-d2014.googlecode.com/svn/arab-d/style.css">');
}
if (type == 'valeur1')
{
	document.write('<link rel="stylesheet" type="text/css" href="https://arab-d2014.googlecode.com/svn/arab-d/style.css">');
}
else if (type == 'valeur2')
{
	document.write('<link rel="stylesheet" type="text/css" href="https://sa3idy.googlecode.com/svn/arab-d.css">');
}
else if (type == 'valeur3')
{
	document.write('<link rel="stylesheet" type="text/css" href="https://sa3idy.googlecode.com/svn/wiki/arab-d/css/main-rollup.css">');
}
else if (type == 'valeur4')
{
	document.write('<link rel="stylesheet" type="text/css" href="https://sa3idy.googlecode.com/svn/style-157af82e-00063.css">');
}
else if (type == 'valeur5')
{
	document.write('<link rel="stylesheet" type="text/css" href="">');
}

function changeskin(change) {
	var scheme = change;
	var name = 'template1';
	var pathname = location.pathname;
	//var myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
	var ExpDate = new Date ();
	ExpDate.setTime(ExpDate.getTime() + (180 * 24 * 3600 * 1000));
	setCookie(name,scheme,ExpDate,'/');
}
function getCookie(name){
	var cname = name + "=";
	var dc = document.cookie;
	if (dc.length > 0) {
		begin = dc.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
			return unescape(dc.substring(begin, end));
		}
	}
	return null;
}
function setCookie(name, value, expires, path, domain, secure) { 
	document.cookie = name + "=" + escape(value) +
	((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
	((path == null) ? "" : "; path=" + path) +
	((domain == null) ? "" : "; domain=" + domain) +
	((secure == null) ? "" : "; secure");
}